<?php
class db{
	private $con;
	private $dbhost;
	private $username;
	private $password;
	private $db;

	public function __construct(){
		$this->dbhost = "localhost";
		$this->username = "root";
		$this->password = "root";
		$this->db = "uutime";
	}

	public function db_connect(){
		$this->con=mysqli_connect($this->dbhost , $this->username , $this->password , $this->db) or die("Unable to connect to the MySQL!");
		mysqli_set_charset($this->con,"utf8");
	}

	public function db_close(){
		mysqli_close($this->con);
	}

	public function insertConstellation($constellation,$constellationData){
		$time = date("Y-m-d",time());
		// var_dump($constellationData);
		mysqli_query($this->con,"insert into uu_constellation (today,weekly,month,year,year_love,constellation,time) values (\"{$constellationData['today']}\",\"{$constellationData['weekly']}\",\"{$constellationData['month']}\",\"{$constellationData['year']}\",\"{$constellationData['year_love']}\",\"{$constellation}\",\"{$time}\")");
	}

	public function insertHD($hd){
		$time = date("Y-m-d",time());
		mysqli_query($this->con,"insert into uu_indexhd (hd,time) values (\"{$hd}\",\"{$time}\")");
	}
	
	
	
}

?>